<!DOCTYPE html>
<html>
<head> 
	<title>My Info</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<link rel="stylesheet" href="__ROOT__/public/static/layui/css/layui.css" media="all">
	<script src="__ROOT__/public/static/layui/layui.js" charset="utf-8"></script> 
	<script type="text/javascript" src="__ROOT__/public/static/jquery-3.4.1.min.js"></script> 
</head>
<body>
	<ul class="layui-nav" lay-filter="header">
		<li class="layui-nav-item"><a href="firstPageInfo">首页信息</a></li>
		<li class="layui-nav-item" ><a href="mypapers">试卷分析列表</a></li>
		<li class="layui-nav-item layui-this" ><a href="myinfo">我的信息</a></li> 
		<li class="layui-nav-item layui-layout-right" >____工号:{$gh}____</li> 
	</ul>


<div style="margin-top: 100px;margin-left: 60px">
	<button type="button" onclick="changpassword()" class="layui-btn">修改密码</button>
</div>
<div  id="changepsd" style="display: none;margin-top: 10px;margin-left: 80px;width: 600px;height: 200px;border: 1px solid red;border-radius: 5px">
	<form id="tt" class="layui-form">
		<div class="layui-form-item"> 
		<label class="layui-form-label">原密码</label>
		<div class="layui-input-inline">
	    		<input type="password0" name="password0"  placeholder="请输入原密码" autocomplete="off" class="layui-input">
	    	</div>
	    </div>
		<div class="layui-form-item"> 
		<label class="layui-form-label">新密码</label>
			<div class="layui-input-inline">
	    		<input type="password1" name="password1"  placeholder="请输入新密码" autocomplete="off" class="layui-input">
	    	</div>
	    </div>
	    <div class="layui-form-item">
	    	<label class="layui-form-label">确认密码</label>
	    	<div class="layui-input-inline">
	    		<input type="password2" name="password2"  placeholder="请输入确认密码" autocomplete="off" class="layui-input">
	    	</div>
	    	<div class="layui-form-mid layui-word-aux">再输入一次相同密码以确认</div>
	    </div>
	    <div class="layui-form-item">
	    	<div class="layui-input-block">
	    		<button class="layui-btn" lay-submit lay-filter="queren">确认</button>
	    		<button class="layui-btn" onclick="closediv()">取消</button>
	    	</div>
	    </div>
	</form>
</div> 
<div style="margin-top: 50px;margin-left: 60px">
	<button type="button" onclick="logout()" class="layui-btn">退出系统</button>
</div>
<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  
  //监听提交
  form.on('submit(queren)', function(data){
    // layer.msg(JSON.stringify(data.field));
    jQuery.ajax({
    	type:"POST",
            contentType:"application/json;charset=UTF-8",
            url:"{$baseurl}/index.php/index/dc/changpassword",
            data:JSON.stringify(data.field),
            beforeSend:function(){	

              layer.msg('正在验证......');
            },
            success:function (result) {
            	// debugger;
              var x=JSON.parse(result);
              if (x.result==1) {
                layer.msg('密码修改成功');
              }else{
                layer.msg(x.info);
              }
            }
    });
    return false;
  });

});
</script>


<script>
layui.use(['layer','element'], function(){
  var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
  //监听导航点击
  element.on('nav(header)', function(elem){
    // console.log(elem)
    // layer.msg(elem.text());
  });
});
</script>
<script type="text/javascript">
	function logout() {
		jQuery.ajax({
            type:"POST",
            contentType:"application/json;charset=UTF-8",
            url:"{$baseurl}/index.php/index/dc/logout",
            //data:JSON.stringify(d.field),
            beforeSend:function(){
              layer.msg('正在退出......');
            },
            success:function (result) {
              var x=JSON.parse(result);
              if (x.result==1) {
                window.location.href='firstpageinfo';
              }
            }
          });
	}
	function changpassword() {
		var t=document.getElementById('changepsd');
		t.setAttribute("style","display: ;margin-top: 10px;margin-left: 180px;width: 600px;height: 200px;border: 1px solid red;border-radius: 5px;padding:8px");
		// layer.msg('chang');
	}
	function closediv() {
		var t=document.getElementById('changepsd');
		t.setAttribute("style","display:none ");
		return false;
	}
</script>
<div class="layui-footer" style="margin-bottom: 0px;position:fixed;  bottom:0px;">
 卷面数据分析应用程序 Copyright © 2020 Math HZNU. All rights reserved.
</div>
</body>
</html>